#encoding=utf-8
#Modify the specified content of all files in the specified directory
#Modified by foce123
#email:foce123@sina.com

import os

dirs='/tmp/ss'

def search(path):
        for filename in os.listdir(path):
                fp=os.path.join(path,filename)
                if os.path.isfile(fp):
			print fp
                        os.system('sed -i "s#\/alidata#\/usr\/local#g" '+fp)
                elif os.path.isdir(fp):
                        search(fp)

search(dirs)

